enable_testing()

# /desktop-integration/
vala_precompile(VALA_TEST_DESKTOP_INTEGRATION_C
    test-desktop-integration.vala
    ../src/desktop-integration.vala
    ../src/dbus/freedesktop-filemanager.vala
  PACKAGES
    gtk+-3.0
)

add_executable(
  ${PROJECT_NAME}-test-desktop-integration
  ${VALA_TEST_DESKTOP_INTEGRATION_C})

add_test(
  test-desktop-integration
  ${PROJECT_NAME}-test-desktop-integration)

add_dependencies(
  ${PROJECT_NAME}-test-desktop-integration
  ${PROJECT_NAME})

# /utils/
vala_precompile(VALA_TEST_UTILS_C
    test-utils.vala
    ../src/defaults.vala
    ../src/utils.vala
  PACKAGES
    gtk+-3.0
)

add_executable(
  ${PROJECT_NAME}-test-utils
  ${VALA_TEST_UTILS_C})

add_test(
  test-utils
  ${PROJECT_NAME}-test-utils)

add_dependencies(
  ${PROJECT_NAME}-test-utils
  ${PROJECT_NAME})

# /screen-recorder/recording-area/
vala_precompile(VALA_TEST_RECORDING_AREA_C
    screen-recorder/test-recording-area.vala
    ../src/recording/recording-area.vala
  PACKAGES
    gtk+-3.0
)

add_executable(
  ${PROJECT_NAME}-screen-recorder-test-recording-area
  ${VALA_TEST_RECORDING_AREA_C})

add_test(
  screen-recorder-test-recording-area
  ${PROJECT_NAME}-screen-recorder-test-recording-area)

add_dependencies(
  ${PROJECT_NAME}-screen-recorder-test-recording-area
  ${PROJECT_NAME})

# /screen-recorder/cli-screen-recorder/
vala_precompile(VALA_TEST_COMMAND_LINE_SCREEN_RECORDER_C
    screen-recorder/test-cli-screen-recorder.vala
    ../src/post-processing/cli-post-processor.vala
    ../src/post-processing/extract-frames-post-processor.vala
    ../src/post-processing/ffmpeg-post-processor.vala
    ../src/post-processing/gifski-post-processor.vala
    ../src/post-processing/post-processing-pipeline.vala
    ../src/post-processing/post-processor.vala
    ../src/recording/recording-area.vala
    ../src/recording/recording-config.vala
    ../src/recording/screen-recorder.vala
    ../src/recording/base-screen-recorder.vala
    ../src/recording/cli-screen-recorder.vala
    ../src/defaults.vala
    ../src/errordomain.vala
    ../src/utils.vala
  PACKAGES
    gtk+-3.0
    posix
)

add_executable(
  ${PROJECT_NAME}-test-screen-recorder-cli-screen-recorder
  ${VALA_TEST_COMMAND_LINE_SCREEN_RECORDER_C})

add_test(
  test-screen-recorder-cli-screen-recorder
  ${PROJECT_NAME}-test-screen-recorder-cli-screen-recorder)

add_dependencies(
  ${PROJECT_NAME}-test-screen-recorder-cli-screen-recorder
  ${PROJECT_NAME})
